Skip to content

litt sharding simple sharding#3395

Open
cody-littley wants to merge 4 commits into
mainfrom
cjl/litt-sharding
Open

litt sharding simple sharding#3395
cody-littley wants to merge 4 commits into
mainfrom
cjl/litt-sharding

Conversation

@cody-littley
Copy link
Copy Markdown
Contributor

Describe your changes and provide context

This PR simplifies how littDB assignes values to shards. The net result of this change is that we don't need the siphash library any more. Previously, LittDB needed this library for shard assignment.

Testing performed to validate your change

Benchmarked this particular schema when evaluating LittDB performance for block storage.

@cody-littley cody-littley requested review from Kbhat1 and blindchaser May 5, 2026 19:37
@cody-littley cody-littley self-assigned this May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 5, 2026, 7:40 PM

@@ -233,18 +233,13 @@ the [value](#value) associated with a [key](#key) can be retrieved from disk.
An address is encoded in a 64-bit integer. It contains two pieces of information:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from ai: The implementation now serializes a 13-byte address, not a 64-bit integer, and the offset points at the value length prefix. Update this before merging.

}

// DeserializeAddress converts a byte slice to an Address. The slice must be exactly AddressSerializedSize bytes.
func DeserializeAddress(bytes []byte) (Address, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: DeserializeAddress accepts any byte as ShardID, but these paths index s.shards without validating it is < len(s.shards). A bad keymap entry or damaged key file can turn a read/restart into a runtime panic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants